package net.teamclerks.rpgf.avatar;

import java.util.List;

import net.teamclerks.rpgf.inventory.item.Item;
import net.teamclerks.rpgf.script.director.Director;

/**
 * ChestAvatar is an Avatar implementation that handles simply
 * sitting around until the PlayerAvatar acts on it. It will,
 * in practice on average, only have one action that simply puts
 * some item into an inventory, but it will occassionally start
 * a battle, or some dialog event, or something else entirely.
 * @author msmith
 */
public abstract class ChestAvatar extends Avatar
{
  /// DATAPOINTS ///
  /**
   * Basically every Chest ever encountered should have item(s)
   * associated with it. The default control for null items is
   * an "empty" chest.<br/>
   * <br/> 
   * BattleChestsAvatars can have Items associated with them as
   * well, but the ChestAction needs to be fired after the battle
   * concludes -OR- the Item needs to be a reward from the battle.
   */
  protected List<Item> items;
  /**
   * Whether the chest is opened.<br/><br/>Default is false.
   */
  protected boolean opened;
  /**
   * Whether the chest is locked/unlocked.<br/><br/>Default is false.
   */
  protected boolean locked;
  
  /// PUBLIC CONSTRUCTOR ///
  /**
   * Public constructor.
   * @param director
   */
  public ChestAvatar(Director director)
  {
    super(director);
    this.opened = false;
    this.locked = false;
  }

  /// PUBLIC METHODS ///
  /**
   * Gets the list of Items that this ChestAvatar contains.
   * @return the items
   */
  public final List<Item> getItems()
  {
    return items;
  }
  /**
   * Sets the list of Items that this ChestAvatar contains.
   * @param items the items to set
   */
  public final void setItems(List<Item> items)
  {
    this.items = items;
  }
  /**
   * Gets whether this ChestAvatar has been opened already.
   * @return the opened
   */
  public final boolean isOpened()
  {
    return opened;
  }
  /**
   * Sets whether this ChestAvatar has been opened already.
   * @param opened the opened to set
   */
  public final void setOpened(boolean opened)
  {
    this.opened = opened;
  }
  /**
   * Gets whether this ChestAvatar is locked.
   * @return the locked
   */
  public final boolean isLocked()
  {
    return locked;
  }
  /**
   * Sets whether this ChestAvatar is locked.
   * @param locked the locked to set
   */
  public final void setLocked(boolean locked)
  {
    this.locked = locked;
  }
}
